package com.chinda.modules.service.impl;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.chinda.common.page.RPage;
import com.chinda.common.service.ServiceImpl;

import com.chinda.modules.dao.GeneratorDao;
import com.chinda.modules.entity.GeneratorEntity;
import com.chinda.modules.qo.GeneratorQO;
import com.chinda.modules.service.GeneratorService;


@Service("generatorService")
@Transactional(readOnly = true, rollbackFor = Exception.class)
public class GeneratorServiceImpl extends ServiceImpl<GeneratorDao, GeneratorEntity> implements GeneratorService {

    private final GeneratorDao generatorDao;

    public GeneratorServiceImpl(GeneratorDao generatorDao) {
        this.generatorDao = generatorDao;
    }

    @Override
    public RPage<GeneratorEntity> queryPage(GeneratorQO qo) {
        return new RPage<>(generatorDao.findAll(qo.getPredicate(), qo.getPageRequest()));
    }
}